 1.YARN-HA工作机制
   
   官方文档
   https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html
   YARN-HA工作机制，如图3-23所示
 
 2.配置YARN-HA集群
   
   1).环境准备
      修改IP
      修改主机名及主机名和IP地址的映射
      关闭防火墙
      ssh免密登录
      安装JDK，配置环境变量量等
      配置Zookeeper集群
   2).规划集群
   linux121      linux122        linux123
   NameNode      NameNode
   JournalNode  JournalNode    JournalNode
   DataNode      DataNode        DataNode
     ZK            ZK              ZK
               ResourceManager
   NodeManager  NodeManager     NodeManager
   3).具体配置
   4).yarn-site.xml
   <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
    <!--启⽤用resourcemanager ha-->
    <property>
        <name>yarn.resourcemanager.ha.enabled</name>
        <value>true</value>
    </property>
    <!--声明两台resourcemanager的地址-->
    <property>
        <name>yarn.resourcemanager.cluster-id</name>
        <value>cluster-yarn</value>
    </property>
    <property>
        <name>yarn.resourcemanager.ha.rm-ids</name>
        <value>rm1,rm2</value>
    </property>
    <property>
        <name>yarn.resourcemanager.hostname.rm1</name>
        <value>linux122</value>
    </property>
    <property>
        <name>yarn.resourcemanager.hostname.rm2</name>
        <value>linux123</value>
    </property>
    <!--指定zookeeper集群的地址-->
    <property>
        <name>yarn.resourcemanager.zk-address</name>
        <value>linux121:2181,linux122:2181,linux123:2181</value>
    </property>
    <!--启⽤用⾃自动恢复-->
    <property>
        <name>yarn.resourcemanager.recovery.enabled</name>
        <value>true</value>
    </property>
    <!--指定resourcemanager的状态信息存储在zookeeper集群-->
    <property>
        <name>yarn.resourcemanager.store.class</name>
        <value>org.apache.hadoop.yarn.server.resourcemanager.recovery.ZKRMStateStore</value>
    </property>
	同步更新其他节点的配置信息
	rsync-script yarn-site.xml
	sbin/start-yarn.sh